app.character = {
	_name : null,
	_class : null,
	_statsList : null,
	
	init : function() {
		this.refresh();
		
		$('#characterActionClose').click(function() {
			app.show('area');
			
			return false;
		});
	},
	
	refresh : function() {
		var unit = app.player;
		var that = this;
		
		this._name = $('#characterName');
		this._class = $('#characterClass');
		this._statsList = $('#characterStats dl').empty();
		
		this._name.text(unit.name);
		this._class.text(unit.className);
		
		$.each(unit.attributes, function(index, attribute) {
			if ('exp' == index) {
				return;
			}
			
			$('<dt>')
				.text(app._(index))
				.appendTo(that._statsList);
			$('<dd>')
				.append(unit.getAttrWithModsObject(index))
				.appendTo(that._statsList);
		});
	},
	
	showStats : function() {
		this.refresh();
		
		app.show('character');
	}
};